package com.ruoyi.web.controller.system;

import java.util.List;
import javax.servlet.http.HttpServletResponse;

import com.ruoyi.common.annotation.RepeatSubmit;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.ruoyi.common.annotation.Log;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.enums.BusinessType;
import com.ruoyi.system.domain.MdjfCaseBczl;
import com.ruoyi.system.service.IMdjfCaseBczlService;
import com.ruoyi.common.utils.poi.ExcelUtil;
import com.ruoyi.common.core.page.TableDataInfo;

/**
 * 矛盾纠纷--事件办结--补充资料Controller
 * 
 * @author ruoyi
 * @date 2025-03-28
 */
@Api("矛盾纠纷--事件办结--补充资料")
@RestController
@RequestMapping("/system/bczl")
public class MdjfCaseBczlController extends BaseController
{
    @Autowired
    private IMdjfCaseBczlService mdjfCaseBczlService;

    /**
     * 查询矛盾纠纷--事件办结--补充资料列表
     */
    @ApiOperation("查询参数列表")
    @PreAuthorize("@ss.hasPermi('system:bczl:list')")
    @GetMapping("/list")
    public TableDataInfo list(MdjfCaseBczl mdjfCaseBczl)
    {
        startPage();
        List<MdjfCaseBczl> list = mdjfCaseBczlService.selectMdjfCaseBczlList(mdjfCaseBczl);
        return getDataTable(list);
    }

    /**
     * 导出矛盾纠纷--事件办结--补充资料列表
     */
    @ApiOperation("导出参数列表")
//    @PreAuthorize("@ss.hasPermi('system:bczl:export')")
    @Log(title = "矛盾纠纷--事件办结--补充资料", businessType = BusinessType.EXPORT)
    @PostMapping("/export")
    public void export(HttpServletResponse response, MdjfCaseBczl mdjfCaseBczl)
    {
        List<MdjfCaseBczl> list = mdjfCaseBczlService.selectMdjfCaseBczlList(mdjfCaseBczl);
        ExcelUtil<MdjfCaseBczl> util = new ExcelUtil<MdjfCaseBczl>(MdjfCaseBczl.class);
        util.exportExcel(response, list, "矛盾纠纷--事件办结--补充资料数据");
    }

    /**
     * 获取矛盾纠纷--事件办结--补充资料详细信息
     */
    @ApiOperation("查询资料详细信息")
//    @PreAuthorize("@ss.hasPermi('system:bczl:query')")
    @GetMapping(value = "/{caseBczlId}")
    public AjaxResult getInfo(@PathVariable("caseBczlId") Long caseBczlId)
    {
        return success(mdjfCaseBczlService.selectMdjfCaseBczlByCaseBczlId(caseBczlId));
    }

    /**
     * 新增矛盾纠纷--事件办结--补充资料
     */
    @ApiOperation("新增资料")
//    @PreAuthorize("@ss.hasPermi('system:bczl:add')")
    @Log(title = "矛盾纠纷--事件办结--补充资料", businessType = BusinessType.INSERT)
    @PostMapping
    @RepeatSubmit(interval = 1000, message = "请求过于频繁")
    public AjaxResult add(@RequestBody MdjfCaseBczl mdjfCaseBczl)
    {
        return toAjax(mdjfCaseBczlService.insertMdjfCaseBczl(mdjfCaseBczl));
    }

    /**
     * 修改矛盾纠纷--事件办结--补充资料
     */
    @ApiOperation("修改资料")
//    @PreAuthorize("@ss.hasPermi('system:bczl:edit')")
    @Log(title = "矛盾纠纷--事件办结--补充资料", businessType = BusinessType.UPDATE)
    @RepeatSubmit(interval = 1000, message = "请求过于频繁")
    @PutMapping
    public AjaxResult edit(@RequestBody MdjfCaseBczl mdjfCaseBczl)
    {
        return toAjax(mdjfCaseBczlService.updateMdjfCaseBczl(mdjfCaseBczl));
    }

    /**
     * 删除矛盾纠纷--事件办结--补充资料
     */
    @ApiOperation("删除资料")
//    @PreAuthorize("@ss.hasPermi('system:bczl:remove')")
    @Log(title = "矛盾纠纷--事件办结--补充资料", businessType = BusinessType.DELETE)
    @RepeatSubmit(interval = 1000, message = "请求过于频繁")
	@DeleteMapping("/{caseBczlIds}")
    public AjaxResult remove(@PathVariable Long[] caseBczlIds)
    {
        return toAjax(mdjfCaseBczlService.deleteMdjfCaseBczlByCaseBczlIds(caseBczlIds));
    }
}
